package cn.zhibang.sannuo.account.service.impl;

import cn.zhibang.sannuo.account.dao.AAccountnumberDao;
import cn.zhibang.sannuo.account.dao.AMenuDao;
import cn.zhibang.sannuo.account.service.AAccountnumderService;
import cn.zhibang.sannuo.commons.model.Accountnumber;
import cn.zhibang.sannuo.commons.model.HeadOffice;
import cn.zhibang.sannuo.commons.model.Menu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author admin
 * @version 1.0.0
 * @ClassName AAccountnumderServiceImpl.java
 * @Description TODO
 * @createTime 2021年03月30日 15:41:00
 */
@Service
public class AAccountnumderServiceImpl implements AAccountnumderService {

    @Autowired private AAccountnumberDao aAccountnumberDao;
    @Autowired private AMenuDao aMenuDao;

    @Override
    public Accountnumber selAccountnumber(String account) {
        return aAccountnumberDao.selectAccountnumber(account);
    }

    @Override
    public List<Menu> selMenuMids(String account) {
        String mids = aAccountnumberDao.selectAccountnumberMid(account);
        return aMenuDao.selectMenuMids(mids);
    }

    @Override
    public String selAccountnumberRnumber(String account) {
        return aAccountnumberDao.selectAccountnumberRnumber(account);
    }

    @Override
    public List<Accountnumber> selAccountnumberList(String bnumbers, String bnumber, String phone, String aname, String state, String baddress, String bleng) {
        return aAccountnumberDao.selectAccountnumberList(bnumbers, bnumber, phone, aname, state, baddress, bleng);
    }


    @Override
    public List<HeadOffice> getAllHeadOffice() {
        return aAccountnumberDao.selectAllHeadOffice();
    }

    @Override
    public void upAccountnumber(Accountnumber accountnumber) {
        aAccountnumberDao.updataAccountnumber(accountnumber);
    }

    @Override
    public Integer addAccountnumber(Accountnumber accountnumber) {
        return aAccountnumberDao.insertAccountnumber(accountnumber);
    }

    @Override
    public void addAccountRole(Integer aid, Integer rid) {
        aAccountnumberDao.insertAccountRole(aid, rid);
    }

}
